package model.metier;
// Generated 4 mars 2015 13:49:36 by Hibernate Tools 4.3.1


import java.util.Date;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * FactureClient generated by hbm2java
 */
@Entity
@Table(name="facture_client"
    ,catalog="stocks_bdd"
)
public class FactureClient extends Metier implements java.io.Serializable {


     private Integer id;
     private CommandeClient commandeClient;
     private Date date;
     private double prixTotal;
     private Set<HistoProduitFactureClient> histoProduitFactureClients = new HashSet(0);

    public FactureClient() {
    }

	
    public FactureClient(CommandeClient commandeClient, Date date, double prixTotal) {
        this.commandeClient = commandeClient;
        this.date = date;
        this.prixTotal = prixTotal;
    }
    public FactureClient(CommandeClient commandeClient, Date date, double prixTotal, Set<HistoProduitFactureClient> histoProduitFactureClients) {
       this.commandeClient = commandeClient;
       this.date = date;
       this.prixTotal = prixTotal;
       this.histoProduitFactureClients = histoProduitFactureClients;
    }
   
     @Id @GeneratedValue(strategy=IDENTITY)

    
    @Column(name="id", unique=true, nullable=false)
    public Integer getId() {
        return this.id;
    }
    
    public void setId(Integer id) {
        this.id = id;
    }

@ManyToOne(fetch=FetchType.LAZY)
    @JoinColumn(name="id_commande_client", nullable=false)
    public CommandeClient getCommandeClient() {
        return this.commandeClient;
    }
    
    public void setCommandeClient(CommandeClient commandeClient) {
        this.commandeClient = commandeClient;
    }

    @Temporal(TemporalType.TIMESTAMP)
    @Column(name="date", nullable=false, length=19)
    public Date getDate() {
        return this.date;
    }
    
    public void setDate(Date date) {
        this.date = date;
    }

    
    @Column(name="prix_total", nullable=false, precision=22, scale=0)
    public double getPrixTotal() {
        return this.prixTotal;
    }
    
    public void setPrixTotal(double prixTotal) {
        this.prixTotal = prixTotal;
    }

@OneToMany(fetch=FetchType.LAZY, mappedBy="factureClient")
    public Set<HistoProduitFactureClient> getHistoProduitFactureClients() {
        return this.histoProduitFactureClients;
    }
    
    public void setHistoProduitFactureClients(Set<HistoProduitFactureClient> histoProduitFactureClients) {
        this.histoProduitFactureClients = histoProduitFactureClients;
    }




}


